import {addShareApply, getPreviewLinkPath, queryGroupList, queryMyFiles, queryShareFiles} from '@/services/workspace';

export default {
  namespace: 'groupsModel',

  state: {
    // 列表数据
    data: {
      dataList: [],
      pageNum: 0,
      pageSize: 0,
      totalCount: 0,
    },
    queryForm: {},

  },

  effects: {
    * queryGroupList({payload, callback}, {call, put}) {
      const response = yield call(queryGroupList, payload);
      if (response && response.result == 'ok') {
        yield put({
          type: 'saveData',
          payload: response,
        });
      }
      if (callback) callback(response);
    },


  },

  reducers: {
    saveData(state, action) {
      return {
        ...state,
        data: action.payload.data,
      };
    },
  },
};
